import%20marimo%0A%0A__generated_with%20%3D%20%220.17.6%22%0Aapp%20%3D%20marimo.App(auto_download%3D%5B%22ipynb%22%2C%20%22html%22%5D)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20import%20pytz%0A%20%20%20%20import%20datetime%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20india_timezone%20%3D%20pytz.timezone(%22Asia%2FKolkata%22)%0A%20%20%20%20now%20%3D%20datetime.datetime.now(india_timezone)%0A%0A%20%20%20%20curr%20%3D%20now.strftime(%22%25Y-%25m-%25d%2C%20%25I%3A%25M%3A%25S%20%25p%20%25Z%22)%0A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20rf%22%22%22%0A%20%20%20%20%23%20Week%20-%201%20(Dataset%20-%201)%0A%0A%20%20%20%20**Submission%20Date%3A**%20%602025-10-05%2C%2023%3A59%20IST%60%0A%0A%20%20%20%20**Last%20Updated%3A**%20%60%7Bcurr%7D%60%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%20(mo%2C)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20import%20pandas%20as%20pd%0A%20%20%20%20return%20np%2C%20pd%0A%0A%0A%40app.cell%0Adef%20_(pd)%3A%0A%20%20%20%20df%20%3D%20pd.read_csv(%22Week-1%2FGraded%20Assignment%201.1%2FWeek1_GA_dataset-1.csv%22)%0A%20%20%20%20return%20(df%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Basic%20Dataset%20Inspection%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20assert%20df.shape%20%3D%3D%20(10000%2C%2012)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.head()%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.describe()%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.info()%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.isnull().sum()%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df%5B%0A%20%20%20%20%20%20%20%20~df%5B%22Locality%22%5D.isnull()%0A%20%20%20%20%20%20%20%20%26%20~df%5B%22Estimated%20Value%22%5D.isnull()%0A%20%20%20%20%20%20%20%20%26%20~df%5B%22carpet_area%22%5D.isnull()%0A%20%20%20%20%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%201%0A%0A%20%20%20%20How%20many%20unknown%20(%22%3F%22)%20values%20are%20present%20in%20the%20dataset%3F%20Remove%2FDelete%20unknown%20(%22%3F)%20values%20present%20in%20the%20dataset%20to%20make%20it%20null%20value.%0A%20%20%20%20Remove%2FDelete%20-%20means%20it%20will%20show%20NAN%20in%20place%20of%20%22%3F%22%0A%0A%20%20%20%20**Note%3A**%20If%20there%20is%20no%20value%20present%20in%20the%20dataset%20it%20is%20represented%20as%20NAN(read%20pandas%20documentation%20for%20all%20the%20other%20ways%20to%20represent%20null%20values)%20in%20data%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df%2C%20np)%3A%0A%20%20%20%20qu_count%20%3D%20(df%20%3D%3D%20%22%3F%22).sum().sum()%0A%20%20%20%20df.replace(%22%3F%22%2C%20np.nan%2C%20inplace%3DTrue)%0A%20%20%20%20qu_count%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%202%0A%0A%20%20%20%20What%20is%20the%20shape%20of%20the%20dataset%20%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.shape%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%203%0A%0A%20%20%20%20What%20is%20the%20value%20present%20at%20the%20692th%20indexed%20row%20and%200th%20indexed%20column%20in%20the%20data%20%3F%0A%0A%20%20%20%20dataframe%5B692%2C0%5D%20(simpy%20saying%20this%20in%20a%20matrix)%0A%20%20%20%20rows%2F%20columns%20starts%20indexing%20from%20zero(0)%20in%20python%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.iloc%5B692%2C%200%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%204%0A%0A%20%20%20%20What%20is%20the%20value%20present%20at%20the%20546th%20indexed%20row%20and%207th%20indexed%20column%20in%20the%20data%20%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20df.iloc%5B546%2C%207%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%205%0A%0A%20%20%20%20What%20are%20the%20unique%20values%20present%20in%20the%20Locality%20feature%20of%20the%20dataset%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df%2C%20np)%3A%0A%20%20%20%20np.sort(df%5B%22Locality%22%5D.dropna().unique())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%206%0A%0A%20%20%20%20Which%20of%20the%20following%20features%20have%20missing(NaN)%20values%20present%20in%20the%20dataset%3F%0A%0A%20%20%20%20%3E%20**Note%3A**%20compute%20after%20removing%20%22%3F%22%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20nanCount%20%3D%20df.isnull().sum()%0A%0A%20%20%20%20%23%20Reset%20index%20sets%20the%20index%20to%20numbers%20first%20one%20is%20the%20index%20and%20rest%20are%20from%20%5B0..n-2%5D%20where%20n%20is%20the%20columns%20count%0A%20%20%20%20nanCount%5BnanCount%20%3E%200%5D.reset_index().rename(%0A%20%20%20%20%20%20%20%20columns%3D%7B%22index%22%3A%20%22Feature%22%2C%200%3A%20%22Missing%20Count%22%7D%0A%20%20%20%20)%0A%20%20%20%20return%20(nanCount%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%207%0A%0A%20%20%20%20Which%20of%20the%20following%20feature%20has%20most%20missing(NaN)%20values%20present%20in%20the%20dataset%3F%0A%0A%20%20%20%20%3E%20**Note%3A**%20compute%20after%20removing%20%22%3F%22%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(nanCount)%3A%0A%20%20%20%20nanCount%5BnanCount%20%3D%3D%20nanCount.max()%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%208%0A%0A%20%20%20%20Drop%20all%20the%20samples(rows)%20with%20missing%20values%20strictly%20greater%20than%202.%20How%20many%20samples%20remains%20after%20that%20%3F%0A%0A%20%20%20%20%3E%20**Note%3A**%20compute%20after%20removing%20%22%3F%22%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df)%3A%0A%20%20%20%20%23%20axis%20%3D%200%20means%20count%20NaN%20values%20in%20each%20col%0A%20%20%20%20%23%20axis%20%3D%201%20means%20count%20NaN%20values%20in%20each%20row%0A%20%20%20%20nanRowCount%20%3D%20df.isnull().sum(axis%3D1)%0A%0A%20%20%20%20df%5BnanRowCount%20%3C%3D%202%5D.shape%5B0%5D%0A%20%20%20%20return%20(nanRowCount%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Question%209%0A%0A%20%20%20%20Drop%20all%20the%20samples(rows)%20with%20missing%20values%20in%20the%20original%20dataframe.%20How%20many%20samples%20remains%20after%20that%20%3F%0A%0A%20%20%20%20%3E%20**Note%3A**%20compute%20after%20removing%20%22%3F%22%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(df%2C%20nanRowCount)%3A%0A%20%20%20%20df%5BnanRowCount%20%3E%200%5D.shape%5B0%5D%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
75e2743c3b3af6a411ebb9107ccc6547db0bd12ebb88af3e199c00e57f949ece